﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MND.Test
{
    class ConsoleConnection : Telnet.IMessageSource
    {

        public string GetNextMessage()
        {
            return Console.ReadLine();
        }

        public void Send(string s, Encoding e)
        {
            Console.WriteLine(s, new ASCIIEncoding());
        }

        public void Close()
        {
            Console.WriteLine("---Closing connection---");
            EventHandler<EventArgs> cc = ConnectionClosed;
            if (cc != null)
                cc(this, EventArgs.Empty);
        }

        public event EventHandler<EventArgs> ConnectionClosed;
    }
}
